<!DOCTYPE html>
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{layout}">

<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>

    <title th:text="#{cas.login.pagetitle}">CAS Admin Login View</title>
    <link href="../../static/css/cas.css" rel="stylesheet" th:href="@{${#themes.code('cas.standard.css.file')}}"/>
</head>

<body class="login">
<main role="main" class="container mt-3 mb-3">
    <div layout:fragment="content" style="box-shadow: none;">
        <section class="col-lg-6 offset-lg-3 col-xs-12">
            <div class="card">
                <div class="card-header text-center d-flex justify-content-center mb-4">
                    <h1 th:text="#{cas.login.pagetitle}" class="me-2">Login</h1>
                    <i class="mdi mdi-shield-lock-outline fas fa-shield-alt"></i>
                </div>
                <form name="fm1" th:action="@{/adminlogin}" method="post">
                    <h3 th:utext="#{screen.welcome.instructions}">Enter your Username and Password</h3>
                    <div th:if="${param.error}" id="errorPanel" class="banner banner-danger alert alert-danger banner-dismissible">Invalid credentials.</div>
                    <section class="cas-field my-3 form-group mdc-input-group">
                        <div class="mdc-input-group-field mdc-input-group-field-append">
                            <div class="d-flex caps-check">
                                <label for="username"
                                       class="mdc-text-field mdc-text-field--outlined mdc-text-field--with-trailing-icon control-label">
                                    <span class="mdc-notched-outline">
                                        <span class="mdc-notched-outline__leading"></span>
                                        <span class="mdc-notched-outline__notch">
                                            <span class="mdc-floating-label"
                                                  th:utext="#{screen.welcome.label.netid}">Username</span>
                                        </span>
                                        <span class="mdc-notched-outline__trailing"></span>
                                    </span>
                                    <input class="mdc-text-field__input form-control"
                                           id="username"
                                           name="username"
                                           size="25"
                                           type="text"
                                           th:accesskey="#{screen.welcome.label.password.accesskey}"
                                           autocapitalize="none"
                                           spellcheck="false"
                                           autocomplete="username"/>
                                </label>
                            </div>
                        </div>
                    </section>

                    <section class="cas-field form-group my-3 mdc-input-group caps-check">
                        <div class="mdc-input-group-field mdc-input-group-field-append">
                            <div class="d-flex caps-check">
                                <label for="password"
                                       class="mdc-text-field mdc-text-field--outlined control-label mdc-text-field--with-trailing-icon">
                                    <span class="mdc-notched-outline">
                                        <span class="mdc-notched-outline__leading"></span>
                                        <span class="mdc-notched-outline__notch">
                                            <span class="mdc-floating-label"
                                                  th:utext="#{screen.welcome.label.password}">Username</span>
                                        </span>
                                        <span class="mdc-notched-outline__trailing"></span>
                                    </span>
                                    <input class="mdc-text-field__input form-control pwd" type="password" id="password"
                                           size="25" name="password" th:accesskey="#{screen.welcome.label.password.accesskey}"
                                           autocomplete="off"/>
                                </label>
                                <button class="reveal-password mdc-button mdc-button--raised mdc-input-group-append mdc-icon-button"
                                        tabindex="-1"
                                        type="button">
                                    <i class="mdi mdi-eye reveal-password-icon"></i>
                                    <span class="visually-hidden">Toggle Password</span>
                                </button>
                            </div>
                        </div>
                        <div class="mdc-text-field-helper-line caps-warn">
                            <p class="mdc-text-field-helper-text form-text text-small mdc-text-field-helper-text--persistent mdc-text-field-helper-text--validation-msg text-danger">
                                <span th:utext="#{screen.capslock.on}"/>
                            </p>
                        </div>
                    </section>


                    <button class="mdc-button mdc-button--raised"
                            accesskey="l"
                            th:value="#{screen.welcome.button.login}"
                            value="Login">
                        <span class="mdc-button__label" th:value="#{screen.welcome.button.login}">Login</span>
                    </button>
                </form>
            </div>
        </section>
    </div>
</main>
</body>
</html>
